diff --git a/plugin/VideoLogoOverlay/VideoLogoOverlay.php b/plugin/VideoLogoOverlay/VideoLogoOverlay.php index 4fb0f5dfb..527cd0d2e 100644 --- a/plugin/VideoLogoOverlay/VideoLogoOverlay.php +++ b/plugin/VideoLogoOverlay/VideoLogoOverlay.php @@ -1,131 +1,144 @@ url = ""; $o = new stdClass(); $o->type = array('center' => 'Center', 'top' => 'Top', 'bottom' => 'Bottom', 'top left' => 'Top Left', 'bottom left' => 'Bottom Left', 'top right' => 'Top Right', 'bottom right' => 'Bottom Right'); $o->value = 'top right'; $obj->position = $o; $obj->opacity = 50; $obj->useUserChannelImageAsLogo = true; - $obj->logoMaxWidthPX = 150; return $obj; } public function getPluginVersion() { return "2.1"; } public function getPluginMenu() { global $global; $filename = $global['systemRootPath'] . 'plugin/VideoLogoOverlay/pluginMenu.html'; return file_get_contents($filename); } static function getStyle() { $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); + $opacity = "opacity: " . ($obj->opacity / 100) . "; filter: alpha(opacity={$obj->opacity}); "; - "position: absolute; top: 0; left: 0; opacity: 0.5; filter: alpha(opacity=50);"; - $opacity = "opacity: " . ($obj->opacity / 100) . "; filter: alpha(opacity={$obj->opacity});pointer-events:none; "; + return $opacity; + } - $position = "position: absolute; top: 0; left: 0; "; + static function getClass() { + $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); + $position = "VideoLogoOverlay"; switch ($obj->position->value) { case "center": - $position = "position: absolute; top: 50%; left: 50%; margin-left: -125px; margin-top: -35px; "; + $position .= " VideoLogoOverlay-Center"; break; case "top": - $position = "position: absolute; top: 0; left: 50%; margin-left: -125px; "; + $position .= " VideoLogoOverlay-Top"; break; case "bottom": - $position = "position: absolute; bottom: 0; left: 50%; margin-left: -125px; "; + $position .= " VideoLogoOverlay-Bottom"; break; case "top left": - $position = "position: absolute; top: 0; left: 0; "; + $position .= " VideoLogoOverlay-Top-Left"; break; case "bottom left": - $position = "position: absolute; bottom: 0; left: 0; "; + $position .= " VideoLogoOverlay-Bottom-Left"; break; case "top right": - $position = "position: absolute; top: 0; right: 0; "; + $position .= " VideoLogoOverlay-Top-Right"; break; case "bottom right": - $position = "position: absolute; bottom: 0; right: 0; "; + $position .= " VideoLogoOverlay-Bottom-Right"; break; } - return $position . $opacity; + return $position; } static function getLink() { $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); if (!empty($obj->url)) { $url = $obj->url; } else { $url = "#"; } return $url; } function getFooterCode() { global $global; if (!isVideo()) { return ''; } $style = VideoLogoOverlay::getStyle(); $url = VideoLogoOverlay::getLink(); + $class = VideoLogoOverlay::getClass(); $obj = AVideoPlugin::getObjectData("VideoLogoOverlay"); $logoOverlay = "{$global['webSiteRootURL']}videos/logoOverlay.png"; - $cols = "col-lg-12 col-md-8 col-sm-7 col-xs-6"; + //$cols = "col-lg-12 col-md-8 col-sm-7 col-xs-6"; if ($obj->useUserChannelImageAsLogo) { $users_id = 0; if ($liveLink_id = isLiveLink()) { $liveLink = new LiveLinksTable($liveLink_id); $users_id = $liveLink->getUsers_id(); } else if ($live = isLive()) { //$live = array('key' => false, 'live_servers_id' => false, 'live_index' => false); $lt = LiveTransmition::getFromKey($live['key']); - $users_id = $lt['users_id']; + $users_id = $lt['users_id']; } else { $videos_id = getVideos_id(); $video = Video::getVideoLight($videos_id); $users_id = $video['users_id']; } if (!empty($users_id)) { $logoOverlay = User::getPhoto($users_id); $url = User::getChannelLink($users_id); - $cols = "col-lg-12 col-md-8 col-sm-7 col-xs-6"; + $class .= ' VideoLogoOverlay-User'; + //$cols = "col-lg-12 col-md-8 col-sm-7 col-xs-6"; } } - if(!empty($url)){ - $style .= 'pointer-events: auto;cursor: pointer;'; + $cols = ""; + + if (!empty($url)) { + $class .= ' VideoLogoOverlay-URL'; } - $html = '
'; + //$logoOverlay = "{$global['webSiteRootURL']}videos/logoOverlay.png"; + + $html = ''; $js = "$('{$html}').appendTo('#mainVideo');"; PlayerSkins::addOnPlayerReady($js); } + public function getHeadCode() { + global $global; + return ""; + } + } diff --git a/plugin/VideoLogoOverlay/style.css b/plugin/VideoLogoOverlay/style.css new file mode 100644 index 000000000..92405c9b6 --- /dev/null +++ b/plugin/VideoLogoOverlay/style.css @@ -0,0 +1,103 @@ +.VideoLogoOverlay{ + position: absolute; + pointer-events: none; +} +.VideoLogoOverlay-URL{ + pointer-events: auto; + cursor: pointer; +} +.VideoLogoOverlay img{ + max-height: 100px; + max-width: 250px; +} +.VideoLogoOverlay-Center{ + top: 50%; + left: 50%; + margin-left: -125px; + margin-top: -35px; +} +.VideoLogoOverlay-Top{ + top: 10px; + left: 50%; + margin-left: -125px; +} +.VideoLogoOverlay-Bottom{ + bottom: 10px; + left: 50%; + margin-left: -125px; +} +.VideoLogoOverlay-User.VideoLogoOverlay-Center, +.VideoLogoOverlay-User.VideoLogoOverlay-Top, +.VideoLogoOverlay-User.VideoLogoOverlay-Bottom{ + margin-left: -50px; +} +.VideoLogoOverlay-User.VideoLogoOverlay-Center{ + margin-top: -50px; +} +.VideoLogoOverlay-Top-Left{ + top: 10px; + left: 10px; +} +.VideoLogoOverlay-Bottom-Left{ + bottom: 10px; + left: 10px; +} +.VideoLogoOverlay-Bottom-Right{ + bottom: 10px; + right: 10px; +} +.VideoLogoOverlay-Top-Right{ + top: 10px; + right: 10px; +} + +@media (max-width: 1200px){ + .VideoLogoOverlay img{ + max-height: 70px; + max-width: 150px; + } + + .VideoLogoOverlay-Center, + .VideoLogoOverlay-Top, + .VideoLogoOverlay-Bottom{ + margin-left: -75px; + } + .VideoLogoOverlay-Center{ + margin-top: -21px; + } + + .VideoLogoOverlay-User.VideoLogoOverlay-Center, + .VideoLogoOverlay-User.VideoLogoOverlay-Top, + .VideoLogoOverlay-User.VideoLogoOverlay-Bottom{ + margin-left: -35px; + } + .VideoLogoOverlay-User.VideoLogoOverlay-Center{ + margin-top: -35px; + } +} + +@media (max-width: 767px) { + .VideoLogoOverlay img{ + max-height: 50px; + max-width: 120px; + } + + .VideoLogoOverlay-Center, + .VideoLogoOverlay-Top, + .VideoLogoOverlay-Bottom{ + margin-left: -60px; + } + .VideoLogoOverlay-Center{ + margin-top: -17px; + } + + .VideoLogoOverlay-User.VideoLogoOverlay-Center, + .VideoLogoOverlay-User.VideoLogoOverlay-Top, + .VideoLogoOverlay-User.VideoLogoOverlay-Bottom{ + margin-left: -25px; + } + .VideoLogoOverlay-User.VideoLogoOverlay-Center{ + margin-top: -25px; + } +} +